﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace JiaBao.Services.CustomerService
{
    public interface ICustomerService
    {
        /// <summary>
        /// 获取所有客户
        /// </summary>
        /// <returns></returns>
        DataTable GetAllCustomers();
        /// <summary>
        /// 根据拍卖会id获取客户信息
        /// </summary>
        /// <returns></returns>
        DataTable GetCustomersByAucId(int aucid);


        /// <summary>
        /// 根据拍卖会id获取客户信息
        /// </summary>
        /// <returns></returns>
        DataTable GetCustomersByAucIdAndBuyerOrSaler(int aucid,bool? buyer);
        /// <summary>
        /// 验证用户
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        bool Login(string uid, string pwd);

        /// <summary>
        /// 调用存储过程 更新生日等字段
        /// </summary>
        /// <returns></returns>
        int Update();

        /// <summary>
        /// 调用存储过程 更新 购买总额
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        int UpdateSum(string ids);

        IList<string> GetFields();


        /// <summary>
        /// 自定义 语句
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="parameter"></param>
        /// <returns></returns>
        int ExecuteNonQuery(string sql, params SqlParameter[] parameter);


        /// <summary>
        /// 更改客户标识相关
        /// </summary>
        /// <param name="oldbs"></param>
        /// <param name="newbs"></param>
        /// <returns></returns>
        bool  UpdateKHBS(string oldbs, string newbs);



        DataTable GetByBirthday(DateTime start, DateTime end);
    }
}
